<?php
// src/Acme/StoreBundle/Entity/Product.php
namespace Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="purchase_records")
 */
class PurchaseRecord {
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
    
    /**
     * @ORM\Column(type="smallint")
     */
    protected $type;
    
    /**
     * @ORM\Column(type="float")
     */
    protected $lat;
    
    /**
     * @ORM\Column(type="float")
     */
    protected $lng;
    
    /**
     * @ORM\Column(type="float")
     */
    protected $dist;
    
    /**
     * @ORM\Column(type="datetime")
     */
    protected $date;
    
    /**
     * @ORM\ManyToOne(targetEntity="Purchase", inversedBy="records")
     **/
    protected $owner;

    public function __construct()
    {
        $this->type = 1;
        $this->date = new \DateTime('now');
    }


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set type
     *
     * @param integer $type
     * @return PurchaseRecord
     */
    public function setType($type)
    {
        $this->type = $type;
    
        return $this;
    }

    /**
     * Get type
     *
     * @return integer 
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set date
     *
     * @param \DateTime $date
     * @return PurchaseRecord
     */
    public function setDate($date)
    {
        $this->date = $date;
    
        return $this;
    }

    /**
     * Get date
     *
     * @return \DateTime 
     */
    public function getDate()
    {
        return $this->date;
    }

    /**
     * Set lat
     *
     * @param double $lat
     * @return PurchaseRecord
     */
    public function setLat($lat)
    {
        $this->lat = $lat;
    
        return $this;
    }

    /**
     * Get lat
     *
     * @return double 
     */
    public function getLat()
    {
        return $this->lat;
    }

    /**
     * Set owner
     *
     * @param \Entity\Purchase $owner
     * @return PurchaseRecord
     */
    public function setOwner(\Entity\Purchase $owner = null)
    {
        $this->owner = $owner;
    
        return $this;
    }

    /**
     * Get owner
     *
     * @return \Entity\Purchase 
     */
    public function getOwner()
    {
        return $this->owner;
    }

    /**
     * Set lng
     *
     * @param double $lng
     * @return PurchaseRecord
     */
    public function setLng($lng)
    {
        $this->lng = $lng;
    
        return $this;
    }

    /**
     * Get lng
     *
     * @return double 
     */
    public function getLng()
    {
        return $this->lng;
    }

    /**
     * Set dist
     *
     * @param float $dist
     * @return PurchaseRecord
     */
    public function setDist($dist)
    {
        $this->dist = $dist;
    
        return $this;
    }

    /**
     * Get dist
     *
     * @return float 
     */
    public function getDist()
    {
        return $this->dist;
    }
}